#homework two 设计一个装饰器 记录运行的时间
# -*-coding : utf_8 -*-
import time, functools

def metric(fn):
    def measure_time(*args,**kw):
        start_time = time.time()
        result=fn(*args,**kw)
        end_time = time.time()
        print('耗时：{:.4f}s'.format(end_time - start_time))
        return fn
    return measure_time

@metric
def fast(p):
    time.sleep(0.0012)
    return p*p


@metric
def slow(l,j,k):
    time.sleep(0.0012)
    return l*j*k

xx=fast(9)
yy=slow(5,6,8)


